package com.lingxinst.business.main.ui.dynamic

import android.os.Bundle
import android.view.View
import androidx.appcompat.app.ActionBar
import com.lingxinst.business.main.R
import com.lingxinst.business.main.databinding.FragmentDynamicBinding
import com.lingxinst.farm.base.ui.BaseMvvmFragment

class DynamicFragment :
    BaseMvvmFragment<FragmentDynamicBinding, DynamicViewModel>(R.layout.fragment_dynamic) {

    override fun initTag(): String {
        return this.javaClass.simpleName
    }

    override fun initUIView(
        view: View,
        savedInstanceState: Bundle?,
        actionBar: ActionBar?
    ) {

    }

    override fun getVMClass(): Class<DynamicViewModel> {
        return DynamicViewModel::class.java
    }

    override fun setBindingData() {
        mBinding.vm = mViewModel
    }

    override fun setObserver() {
        super.setObserver()
        mViewModel.text.observe(viewLifecycleOwner) {
            mBinding.textDynamic.text = it
        }
    }

}